﻿#ifndef PST_UNITHELPER_H
#define PST_UNITHELPER_H

#include <QList>
#include <QString>
#include <QVector>

namespace pst
{


    class UnitHelper
    {
    public:
        static QString getKeyTypeAsString(int keyType)
        {
            if (keyType == 1) return "时间";
            if (keyType == 2) return "频率";
            if (keyType == 3) return "Theta"; 
            if (keyType == 4) return "Phi"; 
            if (keyType == 5) return "X坐标"; 
            if (keyType == 6) return "Y坐标"; 
            if (keyType == 7) return "Z坐标";
            if (keyType == 8) return "半径Rho"; 
            if (keyType == 9) return "半径r"; 
            return "";
        }

        static QString getValueTypeAsString(int valueType)
        {
            if (valueType == 0) return "电场-近场";
            if (valueType == 1) return "电场-远场";
            if (valueType == 7) return "增益";
            if (valueType == 8) return "S参数";
            if (valueType == 9) return "驻波比";
            if (valueType == 10) return "电压";
            if (valueType == 11) return "电流";
            if (valueType == 13) return "人体吸收比";
            if (valueType == 16) return "功率";
            if (valueType == 17) return "方向性系数";
            if (valueType == 18) return "雷达散射截面";
            if (valueType == 19) return "反射系数";
            if (valueType == 20) return "磁场-近场";
            return "";
        }

        static int getValueTypeFromString(const QString& valueType)
        {
            if (valueType == "电场-近场") return 0;
            if (valueType == "电场-远场") return 1;
            if (valueType == "增益") return 7;
            if (valueType == "S参数") return 8;
            if (valueType == "驻波比") return 9;
            if (valueType == "电压") return 10;
            if (valueType == "电流") return 11;
            if (valueType == "人体吸收比") return 13;
            if (valueType == "功率") return 16;
            if (valueType == "方向性系数") return 17;
            if (valueType == "雷达散射截面") return 18;
            if (valueType == "反射系数") return 19;
            if (valueType == "磁场-近场") return 20;
            return -1;
        }

        // 0:实部, 1:虚部, 2:幅度, 3:相位 4:标量
        static QString getComponentNameByType(int componentType)
        {
            if(componentType == 0) return "实部";
            if(componentType == 1) return "虚部";
            if(componentType == 2) return "幅度";
            if(componentType == 3) return "相位";
            if(componentType == 4) return "标量";
            return "";
        }

        static int getComponentTypeByName(const QString& componentType)
        {
            if(componentType == "实部") return 0;
            if(componentType == "虚部") return 1;
            if(componentType == "幅度") return 2;
            if(componentType == "相位") return 3;
            if(componentType == "标量") return 4;
            return -1;
        }

        //获取每种key类型可以有哪些单位
        static QList<QString> getKeyUnitListOfType(int keyType)
        {
            QList<QString> result;
            if (keyType == 1)
            {
                result<<"ns"<<"us"<<"ms"<<"s"<<"min"<<"h";
                return result;
            }

            if (keyType == 2)
            {
                result << "HZ" << "KHz" << "MHz" << "GHz";
                return result;
            }

            if (keyType == 3|| keyType == 4)
            {
                result<<"deg";
                return result;
            }

            if (keyType == 5 || keyType == 6 || keyType == 7 || keyType == 8 || keyType == 9)
            {
                result << "mm" << "cm" << "m";
                return result;
            }

            return result;
        }

        //获取每种value类型可以有哪些单位
        static QList<QString> getValueUnitListOfType(int fileType, int componentType)
        {
            QList<QString> result;

            if (componentType == 0 || componentType == 1)//实部、虚部
            {
                return result;
            }

            if (componentType == 2)//幅度
            {
                if (fileType == 0) //电场-近场
                {
                    result << "V/m";
                }
                else if (fileType == 1) //电场-远场
                {
                    result << "V" << "mV";
                }
                //if(valueType == 7)//增益
                //{
                //    result << "";
                //    return result;
                //}
                //if (valueType == 8)//S参数
                //{
                //    result << "";
                //    return result;
                //}
                //if (valueType == 9) //驻波比
                //{
                //    result << "";
                //    return result;
                //}
                else if (fileType == 10) //电压
                {
                    result << "V" << "mV";
                }
                else if (fileType == 11) //电流
                {
                    result << "A" << "mA";
                }
                //if (fileType == 13) //人体吸收比
                //{
                //    result << "W/Kg" << "mW/Kg";
                //    return result;
                //}
                //if (fileType == 16) //功率
                //{
                //    result << "W" << "mW";
                //    return result;
                //}
                //if (valueType == 17) //方向性系数
                //{
                //    result << "";
                //    return result;
                //}
                //if (valueType == 18) //雷达散射截面
                //{
                //    result << "";
                //    return result;
                //}
                //if (valueType == 19) //反射系数
                //{
                //    result << "";
                //    return result;
                //}
                else if (fileType == 20) //磁场-近场
                {
                    result << "A/m";
                }

            }


            else if (componentType == 3) //相位
            {
                result << "deg";
            }

            else if (componentType == 4 )//标量
            {
                if (fileType == 0) //电场-近场
                {
                    result << "V/m";
                }
                else if (fileType == 1) //电场-远场
                {
                    result << "V" << "mV";
                }
                //if(valueType == 7)//增益
                //{
                //    result << "";
                //    return result;
                //}
                //if (valueType == 8)//S参数
                //{
                //    result << "";
                //    return result;
                //}
                //if (valueType == 9) //驻波比
                //{
                //    result << "";
                //    return result;
                //}
                else if (fileType == 10) //电压
                {
                    result << "V" << "mV";
                }
                else if (fileType == 11) //电流
                {
                    result << "A" << "mA";
                }
                else if (fileType == 13) //人体吸收比
                {
                    result << "W/Kg" << "mW/Kg";
                }
                else if (fileType == 16) //功率
                {
                    result << "W" << "mW";
                }
                //if (valueType == 17) //方向性系数
                //{
                //    result << "";
                //    return result;
                //}
                //if (valueType == 18) //雷达散射截面
                //{
                //    result << "";
                //    return result;
                //}
                //if (valueType == 19) //反射系数
                //{
                //    result << "";
                //    return result;
                //}
                else if (fileType == 20) //磁场-近场
                {
                    result << "A/m";
                }
            }


            return result;
        }

        static bool doKeyUnitConvert(int type, const QVector<double>& value, const QString& fromUnit, const QString& toUnit, QVector<double> &result)
        {
            if(fromUnit == toUnit)
            {
                result = value;
                return true;
            }

            if (!checkKeyUnitCanDoConvert(type, fromUnit, toUnit))
            {
                return false;
            }

            double convertFactor = getKeyConvertFactor(type, fromUnit, toUnit);
            result.clear();
            for (const auto& v : value)
            {
                result.append(v * convertFactor);
            }
            return true;
        }

        static bool doValueUnitConvert(int type, int componentType, const QVector<double>& value, const QString& fromUnit, const QString& toUnit, QVector<double>& result)
        {
            if (fromUnit == toUnit)
            {
                result = value;
                return true;
            }

            if (!checkValueUnitCanDoConvert(type, componentType, fromUnit, toUnit))
            {
                return false;
            }

            double convertFactor = getValueConvertFactor(type, fromUnit, toUnit);
            result.clear();
            for (const auto& v : value)
            {
                result.append(v * convertFactor);
            }
            return true;
        }

        private:
        // m->mm 的转换因子为1000, 外部使用乘法
        static double getKeyConvertFactor(int type, const QString& fromUnit, const QString& toUnit)
        {
            double fac = 1.0;
            if (type == 1) return getConvertFactorOfTime(fromUnit, toUnit);
            if (type == 2) return getConvertFactorOfFrequency(fromUnit, toUnit);
            if (type == 3|| type == 4) return getConvertFactorOfAngle(fromUnit, toUnit);
            if (type == 5|| type == 6|| type == 7|| type == 8|| type == 9) return getConvertFactorOfLength(fromUnit, toUnit);
            return fac;
        }

        static double getValueConvertFactor(int type, const QString& fromUnit, const QString& toUnit)
        {
            double fac = 1.0;
            if (type == 0) return getConvertFactorOfElectricNearField(fromUnit, toUnit);
            if (type == 1) return getConvertFactorOfElectricFarField(fromUnit, toUnit);
            if (type == 10) return getConvertFactorOfVoltage(fromUnit, toUnit);
            if (type == 11) return getConvertFactorOfCurrent(fromUnit, toUnit);
            if (type == 13) return getConvertFactorOfSAR(fromUnit, toUnit);
            if (type == 16) return getConvertFactorOfPower(fromUnit, toUnit);
            if (type == 20) return getConvertFactorOfMagneticNearField(fromUnit, toUnit);
            return fac;
        }

        static double getConvertFactorOfFrequency(QString fromUnit, QString toUnit) //频率
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();

            if (_fromUnit == "HZ")
            {
                if (_toUnit == "KHZ") return 0.001;
                if (_toUnit == "MHZ") return 0.000001;
                if (_toUnit == "GHZ") return 0.000000001;
            }
            if(_fromUnit=="KHZ")
            {
                if (_toUnit == "HZ") return 1000;
                if (_toUnit == "MHZ") return 0.001;
                if (_toUnit == "GHZ") return 0.000001;
            }
            if (_fromUnit == "MHZ")
            {
                if (_toUnit == "HZ") return 1000000;
                if (_toUnit == "KHZ") return 1000;
                if (_toUnit == "GHZ") return 0.001;
            }
            if (_fromUnit == "GHZ")
            {
                if (_toUnit == "HZ") return 1000000000;
                if (_toUnit == "KHZ") return 1000000;
                if (_toUnit == "MHZ") return 1000;
            }
            return 1.0;
        }

        static double getConvertFactorOfLength(QString fromUnit, QString toUnit) //长度
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();

            if (_fromUnit == "MM")
            {
                if (_toUnit == "CM") return 0.1;
                if (_toUnit == "M") return 0.001;
            }
            if (_fromUnit == "CM")
            {
                if (_toUnit == "MM") return 10;
                if (_toUnit == "M") return 0.01;
            }
            if (_fromUnit == "M")
            {
                if (_toUnit == "MM") return 1000;
                if (_toUnit == "CM") return 100;
            }
            return 1.0;
        }

        static double getConvertFactorOfAngle(QString fromUnit, QString toUnit) //角度
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();

            if (_fromUnit == "DEG")
            {
                if (_toUnit == "DEG") return 1.0;
            }
            return 1.0;
        }

        static double getConvertFactorOfTime(QString fromUnit, QString toUnit) //时间
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();
            if (_fromUnit == "NS")
            {
                if (_toUnit == "US") return 0.001;
                if (_toUnit == "MS") return 0.000001;
                if (_toUnit == "S") return 0.000000001;
                if (_toUnit == "MIN") return 0.000000001 / 60.0;
                if (_toUnit == "H") return 0.000000001 / 3600.0;
            }
            if (_fromUnit == "US")
            {
                if (_toUnit == "NS") return 1000;
                if (_toUnit == "MS") return 0.001;
                if (_toUnit == "S") return 0.000001;
                if (_toUnit == "MIN") return 0.000001 / 60.0;
                if (_toUnit == "H") return 0.000001 / 3600.0;
            }
            if (_fromUnit == "MS")
            {
                if (_toUnit == "NS") return 1000000;
                if (_toUnit == "US") return 1000;
                if (_toUnit == "S") return 0.001;
                if (_toUnit == "MIN") return 0.001 / 60.0;
                if (_toUnit == "H") return 0.001 / 3600.0;
            }
            if (_fromUnit == "S")
            {
                if (_toUnit == "NS") return 1000000000;
                if (_toUnit == "US") return 1000000;
                if (_toUnit == "MS") return 1000;
                if (_toUnit == "MIN") return 1. / 60.0;
                if (_toUnit == "H") return 1. / 3600.0;
            }
            if (_fromUnit == "MIN")
            {
                if (_toUnit == "NS") return 60000000000.0;
                if (_toUnit == "US") return 60000000.0;
                if (_toUnit == "MS") return 60000.0;
                if (_toUnit == "S") return 60.0;
                if (_toUnit == "H") return 1.0 / 60.0;
            }
            if (_fromUnit == "H")
            {
                if (_toUnit == "NS") return 3600000000000.0;
                if (_toUnit == "US") return 3600000000.0;
                if (_toUnit == "MS") return 3600000.0;
                if (_toUnit == "S") return 3600.0;
                if (_toUnit == "MIN") return 60.0;
            }
            return 1.0;
        }

        static double getConvertFactorOfElectricFarField(QString fromUnit, QString toUnit)//电场-远场
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();
            if (_fromUnit == "V")
            {
                if (_toUnit == "MV") return 1000;
            }
            if (_fromUnit == "MV")
            {
                if (_toUnit == "V") return 0.001;
            }
            return 1.0;
        }

        static double getConvertFactorOfElectricNearField(QString fromUnit, QString toUnit)//电场-近场
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();
            if (_fromUnit == "V/M")
            {
                if (_toUnit == "V/M") return 1.0;
            }
            return 1.0;
        }

        static double getConvertFactorOfMagneticNearField(QString fromUnit, QString toUnit)//磁场-近场
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();
            if (_fromUnit == "A/M")
            {
                if (_toUnit == "A/M") return 1.0;
            }
            return 1.0;
        }

        static double getConvertFactorOfCurrent(QString fromUnit, QString toUnit)//电流
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();
            if (_fromUnit == "A")
            {
                if (_toUnit == "MA") return 1000;
            }
            if (_fromUnit == "MA")
            {
                if (_toUnit == "A") return 0.001;
            }
            return 1.0;
        }

        static double getConvertFactorOfVoltage(QString fromUnit, QString toUnit)//电压
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();
            if (_fromUnit == "V")
            {
                if (_toUnit == "MV") return 1000;
            }
            if (_fromUnit == "MV")
            {
                if (_toUnit == "V") return 0.001;
            }
            return 1.0;
        }

        static double getConvertFactorOfPower(QString fromUnit, QString toUnit)//功率
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();
            if (_fromUnit == "W")
            {
                if (_toUnit == "MW") return 1000;
            }
            if (_fromUnit == "MW")
            {
                if (_toUnit == "W") return 0.001;
            }
            return 1.0;
        }

        static double getConvertFactorOfSAR(QString fromUnit, QString toUnit)//人体吸收比
        {
            if (fromUnit == toUnit) return 1.0;
            QString _fromUnit = fromUnit.toUpper();
            QString _toUnit = toUnit.toUpper();
            if (_fromUnit == "W/KG")
            {
                if (_toUnit == "MW/KG") return 1000;
            }
            if (_fromUnit == "MW/KG")
            {
                if (_toUnit == "W/KG") return 0.001;
            }
            return 1.0;
        }

        static bool checkKeyUnitCanDoConvert(int type, const QString& fromUnit, const QString& toUnit)
        {
            auto unitList = getKeyUnitListOfType(type);
            return unitList.contains(fromUnit) && unitList.contains(toUnit) ? true : false;
        }

        static bool checkValueUnitCanDoConvert(int type, int componentType, const QString& fromUnit, const QString& toUnit)
        {
            auto unitList = getValueUnitListOfType(type, componentType);
            return unitList.contains(fromUnit) && unitList.contains(toUnit) ? true : false;
        }
    };



    //// 1. 定义枚举组
    //enum class Enum_Frequency { HZ = 0, KHZ, MHZ, GHZ };
    //enum class Enum_Length { mm, cm, m };
    //enum class Enum_Angle { deg };
    //enum class Enum_Time { ns, us, ms, s, minites, h };

    //enum class Enum_Elc_Far { V, mV };//电场-远场
    //enum class Enum_Elc_Near { Vpm };  // 电场-近场 V/m
    //enum class Enum_Mag_Near { Apm };//磁场-近场 A/m
    //enum class Enum_Current { A, mA };//电流
    //enum class Enum_Voltage { V, mV };//电压
    //enum class Enum_Power { W, mW };//功率
    //enum class Enum_SAR { WpKg, mWpg };// 人体吸收比 W/Kg  mW/g

    //enum class Enum_Gain { none };//增益
    //enum class Enum_Directionality { none };//方向性系数
    //enum class Enum_RCS { none };//雷达散射截面（RCS）
    //enum class Enum_SParameter { none };//S参数
    //enum class Enum_Throat { none };//驻波比
    //enum class Enum_Reflection { none };//反射系数


    //// 2. 定义 Category 枚举以表示所属组
    //enum class Category { FREQUENCY, LENGTH, ANGLE, TIME,
    //    ELC_FAR, ELC_NEAR, MAG_NEAR, CURRENT, VOLTAGE, POWER, SAR,
    //    GAIN, DIRECTIONALITY, RCS, S_PARAMETER, THROAT, REFLECTION, OTHER };

    //// 3. 用 std::variant 封装所有可能的枚举类型
    //using CurveValue = std::variant<Enum_Frequency, Enum_Length, Enum_Angle, Enum_Time,
    //    Enum_Elc_Far, Enum_Elc_Near, Enum_Mag_Near, Enum_Current, Enum_Voltage, Enum_Power, Enum_SAR,
    //    Enum_Gain, Enum_Directionality, Enum_RCS, Enum_SParameter, Enum_Throat, Enum_Reflection>;

    //enum UnitType
    //{ 
    //    NONE, FREQUENCY, LENGTH, ANGLE, TIME, ELC_FAR, ELC_NEAR, MAG_NEAR, CURRENT, VOLTAGE, POWER, SAR, GAIN, DIRECTIONALITY, RCS, S_PARAMETER, THROAT, REFLECTION, OTHER
    //};


    //class UnitHelper
    //{
       // // 4. 工具：根据 CurveValue 获取组别
       //static Category getCategory(const CurveValue& cv)
       // {
       //    if (std::holds_alternative<Enum_Frequency>(cv)) return Category::FREQUENCY;
       //    if (std::holds_alternative<Enum_Length>(cv)) return Category::LENGTH;
       //    if (std::holds_alternative<Enum_Angle>(cv)) return Category::ANGLE;
       //    if (std::holds_alternative<Enum_Time>(cv)) return Category::TIME;

       //    if (std::holds_alternative<Enum_Elc_Far>(cv)) return Category::ELC_FAR;
       //    if (std::holds_alternative<Enum_Elc_Near>(cv)) return Category::ELC_NEAR;
       //    if (std::holds_alternative<Enum_Mag_Near>(cv)) return Category::MAG_NEAR;
       //    if (std::holds_alternative<Enum_Current>(cv)) return Category::CURRENT;
       //    if (std::holds_alternative<Enum_Voltage>(cv)) return Category::VOLTAGE;
       //    if (std::holds_alternative<Enum_Power>(cv)) return Category::POWER;
       //    if (std::holds_alternative<Enum_SAR>(cv)) return Category::SAR;

       //    if (std::holds_alternative<Enum_Gain>(cv)) return Category::GAIN;
       //    if (std::holds_alternative<Enum_Directionality>(cv)) return Category::DIRECTIONALITY;
       //    if (std::holds_alternative<Enum_RCS>(cv)) return Category::RCS;
       //    if (std::holds_alternative<Enum_SParameter>(cv)) return Category::S_PARAMETER;
       //    if (std::holds_alternative<Enum_Throat>(cv)) return Category::THROAT;
       //    if (std::holds_alternative<Enum_Reflection>(cv)) return Category::REFLECTION;
       //    return Category::OTHER;
       // }

       // // 5. 工具：将枚举值转换为字符串
       // static QString toString(const CurveValue& cv)
       // {
       //     // 定义一个 visitor 结构体
       //     struct
       //     {
       //         std::string operator()(Enum_Frequency v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Frequency::HZ: return "HZ";
       //             case Enum_Frequency::KHZ: return "KHZ";
       //             case Enum_Frequency::MHZ: return "MHZ";
       //             case Enum_Frequency::GHZ: return "GHZ";
       //             }
       //             return "";
       //         }
 
       //         std::string operator()(Enum_Length v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Length::mm: return "mm";
       //             case Enum_Length::cm: return "cm";
       //             case Enum_Length::m: return "m";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Angle v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Angle::deg: return "deg";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Time v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Time::ns: return "ns";
       //             case Enum_Time::us: return "us";
       //             case Enum_Time::ms: return "ms";
       //             case Enum_Time::s: return "s";
       //             case Enum_Time::minites: return "min";
       //             case Enum_Time::h: return "h";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Elc_Far v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Elc_Far::V: return "V";
       //             case Enum_Elc_Far::mV: return "mV";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Elc_Near v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Elc_Near::Vpm: return "V/m";
       //             }
       //             return "";
       //         }
       //         
       //         std::string operator()(Enum_Mag_Near v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Mag_Near::Apm: return "A/m";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Current v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Current::A: return "A";
       //             case Enum_Current::mA: return "mA";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Voltage v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Voltage::V: return "V";
       //             case Enum_Voltage::mV: return "mV";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Power v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Power::W: return "W";
       //             case Enum_Power::mW: return "mW";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_SAR v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_SAR::mWpg : return "mW/g";
       //             case Enum_SAR::WpKg: return "W/Kg";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Gain v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Gain::none: return "none";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Directionality v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Directionality::none: return "none";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_RCS v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_RCS::none: return "none";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_SParameter v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_SParameter::none: return "none";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Throat v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Throat::none: return "none";
       //             }
       //             return "";
       //         }

       //         std::string operator()(Enum_Reflection v) const
       //         {
       //             switch (v)
       //             {
       //             case Enum_Reflection::none: return "none";
       //             }
       //             return "";
       //         }

       //     } visitor;

       //     return  QString::fromStdString( std::visit(visitor, cv));
       // }
    //};

}

#endif
